import React, { Component } from 'react'
import Child11 from './Child11'

export default class Child1 extends Component {
  constructor(){
    super()
    this.state={num:0,price:12.5}
  }
  render() {
    console.log('------Child1的render-----------');
    return (
      <div style={{
        width:'250px',
        height:'200px',
        backgroundColor:'yellow'
      }}>
        Child1---{this.state.num}-- <button onClick={()=>this.setState({...this.state,num:this.state.num+1})}>+</button><br/>
        Price---{this.state.price}--<button onClick={()=>this.setState({...this.state,price:this.state.price+8})}>+</button><br/>
        <Child11 count={this.state.num}></Child11>
      </div>
    )
  }
}
